package com.fhz.mvvmshopjava.ui.goods;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.ViewModel;

import com.fhz.mvvmshopjava.api.ServiceApi;
import com.fhz.mvvmshopjava.core.BaseViewModel;
import com.fhz.mvvmshopjava.entity.Order;
import com.fhz.mvvmshopjava.utils.RetrofitManger;
import com.fhz.utilsfhz.ApiResponse;

import java.util.List;

import javax.inject.Inject;

import dagger.hilt.android.lifecycle.HiltViewModel;

@HiltViewModel
public class GoodsViewModel extends BaseViewModel<GoodsRepository> {

    @Inject
    public GoodsViewModel(GoodsRepository repository) {
        super(repository);
    }

    LiveData<ApiResponse<Order>> addOrder(Order order){
        return repository.addOrder(order);
    }

    LiveData<ApiResponse<List<Order>>> getAllOrderByUser(Integer userId, Integer state){
        return repository.getAllOrderByUser(userId,state);
    }

    LiveData<ApiResponse<String>> updateOrderNum(Integer userId, Integer num){
        return repository.updateOrderNum(userId,num);
    }
}